﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MenuScreen
{
    class menuButton
    {
        public bool selected = false;
        public string text = "menubutton";
        public Rectangle area;


        public menuButton(Rectangle Area, string Text)
        {
            area = Area;            
            text = Text;
        }

        public void mouseOver(MouseState mouseState)
        {
            if ((mouseState.X > area.X) &&
                (mouseState.Y > area.Y) && 
                (mouseState.X < (area.X + area.Width)) &&                
                (mouseState.Y < (area.Y + area.Height)))
            {
                selected = true;
            }
            else 
            {
                selected = false;
            }
        }

        public void Draw(SpriteBatch spriteBatch, SpriteFont spriteFont)
        {
            if (selected == false)
            {
                spriteBatch.DrawString(spriteFont, text, new Vector2(area.X, area.Y), Color.Black);
                
            }

            if (selected == true)
            {
                spriteBatch.DrawString(spriteFont, text, new Vector2(area.X, area.Y), Color.White);
            }
        }
    }
}
